<html>
<body>
  <div id="div1">
    <p>欢迎使用 <b><a href="http://www.wangeditor.com/">wangEditor</a></b> 富文本编辑器</p>
  </div>
</body>
</html>

<script type="text/javascript" src="//unpkg.com/wangeditor/dist/wangEditor.min.js"></script>
<script type="text/javascript">
  const E = window.wangEditor
  const editor = new E('#div1')
  // 或者 const editor = new E( document.getElementById('div1') )
  editor.create()

  //使用base64编码存储图片
  editor.config.uploadImgShowBase64 = true

  console.log(editor.txt.text());
  console.log(editor.txt.html());
  window.aaa = editor;
</script>